/**
 * @Project : algorithm-learning
 * @Author : Ruoyu Wang
 * @User : Momenta
 * @DateTime : 2024/4/16 16:14
 */

#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    void moveZeroes(vector<int> &nums) {
        int j = 0;
        for (int i = 0; i < nums.size(); ++i) {
            if (nums[i] == 0) continue;
            nums[j++] = nums[i];
        }
        for (int i = j; i < nums.size(); ++i) {
            nums[i] = 0;
        }
    }
};